package modeloredesdecomputadores;


import java.util.HashMap;

public class HostTable {
    HashMap<String, String> map;

        public HostTable(){
                map = new HashMap<String, String>();
        }

        public boolean addHost(String name, String ipv4){
                if(map.containsKey(name)){
                        return false;
                } else {
                        this.map.put(name, ipv4);
                        return true;
                }
        }

        public boolean removeHost(String name){
                if(map.containsKey(name)){
                        return false;
                } else {
                        this.map.remove(name);
                        return true;
                }
        }

        public HashMap<String, String> getHostTable(){
                return map;
        }
}
